/*
 * <<
 *  Davinci
 *  ==
 *  Copyright (C) 2016 - 2019 EDP
 *  ==
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *        http://www.apache.org/licenses/LICENSE-2.0
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *  >>
 *
 */

package com.sdkj.dspservice.modules.report.utils.entity;

import com.sdkj.dspservice.modules.report.entity.Source;
import lombok.Data;

@Data
public class JdbcSourceInfo {
    /**
     * jdbc连接
     */
	private String jdbcUrl;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 数据库
     */
    private String database;
    /**
     * 版本
     */
    private String dbVersion;

//    private List<Dict> properties;

    private boolean ext;

//    private JdbcSourceInfo(String jdbcUrl, String username, String password, String database, String dbVersion, List<Dict> properties, boolean ext) {
    private JdbcSourceInfo(String jdbcUrl, String username, String password, String database, String dbVersion, boolean ext) {
        this.jdbcUrl = jdbcUrl;
        this.username = username;
        this.password = password;
        this.database = database;
        this.dbVersion = dbVersion;
//        this.properties = properties;
        this.ext = ext;
    }

    public JdbcSourceInfo(Source source) {
        this.jdbcUrl = source.getDatabaseUrl();
        this.username = source.getDatabaseUsername();
        this.password = source.getDatabasePassword();
        this.database = source.getDatabaseType();
    }

}
